package cn.jingyuan.swan.system.service.impl;

import cn.jingyuan.swan.system.domain.sys.entity.Authority;
import cn.jingyuan.swan.system.enums.SysAuthorityTypeEnum;
import cn.jingyuan.swan.system.model.SimpleAuthority;
import cn.jingyuan.swan.system.model.dto.AuthorityApiDto;
import cn.jingyuan.swan.system.model.dto.AuthorityResourceDto;
import cn.jingyuan.swan.system.service.AuthorityService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.List;

@Slf4j
@Service
public class AuthorityServiceImpl implements AuthorityService {

    @Override
    public Authority saveOrUpdateAuthority(Long resourceId, SysAuthorityTypeEnum resourceType) {
        return null;
    }

    @Override
    public void grantAuthoritys(Long userId, Date expireTime, String... authorityIds) {

    }

    @Override
    public void addAuthorityApp(String appId, Date expireTime, String authorityId) {

    }

    @Override
    public void addAuthorityRole(Long roleId, Date expireTime, String... authorityIds) {

    }

    @Override
    public void addAuthorityApp(String appId, Date expireTime, String... authorityIds) {

    }

    @Override
    public void removeAuthority(Long resourceId, SysAuthorityTypeEnum resourceType) {

    }

    @Override
    public void removeAuthorityApp(String appId) {

    }

    @Override
    public void removeUserAuthority(Long userId, Long authorityId) {

    }

    @Override
    public void clearInvalidApi(String serviceId, Collection<String> codes) {

    }

    @Override
    public Boolean isGranted(Long resourceId, SysAuthorityTypeEnum resourceType) {
        return null;
    }

    @Override
    public Boolean isGrantedByRoleIds(String authorityId, Long... roleIds) {
        return null;
    }

    @Override
    public Authority getAuthority(Long resourceId, SysAuthorityTypeEnum resourceType) {
        return null;
    }

    @Override
    public List<SimpleAuthority> findAuthorityByApp(String appId) {
        return Collections.emptyList();
    }

    @Override
    public List<SimpleAuthority> findAuthorityByRole(Long roleId) {
        return null;
    }

    @Override
    public List<SimpleAuthority> findAuthorityByUser(Long userId) {
        return null;
    }

    @Override
    public List<SimpleAuthority> findAuthorityByType(String type) {
        return null;
    }

    @Override
    public List<AuthorityResourceDto> findAuthorityResource() {
        // FIXME 待完善
        return Collections.emptyList();
    }

    @Override
    public List<AuthorityApiDto> findAuthorityApi(String serviceId) {
        return null;
    }

}
